using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;

using IGlobalist.Cms.Utils;

namespace IGlobalist.Cms.Model
{
    public interface ICmsObjectFactory
    {
        ICmsObject GetNewCmsObject(CmsObjectType type);
    }

    public interface IXml
    {
        bool FromXml(string xml);
        string ToXmlString();
    }

    public interface ICmsClassType
    {
        short ID { get;set;}
        string Name { get;set;}
        string Description { get;set;}
    }

    public interface ICmsClass
    {
        long ID { get;set;}
        string Name { get;set;}
        string DisplayName { get;set;}
        string Description { get;set;}
        short ClassTypeID { get;set;}
        PropertyList PropertyList { get;set;}

        UsageType UsageType { get;set;}
        string ClassSchema { get;set;}

        void AddProperty(BaseProperty property);
        bool RemoveProperty(string propertyName);

        string ToXmlString();
        bool FromXml(string xml);
    }

    public interface ICmsBaseObject : IXml
    {
        long ID { get; set;}
        long FirstVersionID { get; set;}
        string Name { get; set;}
        string Description { get; set;}
        long Author { get; set;}
        short Version { get; set; }
        DateTime CreatedDate { get; set;}
        long EditedBy { get; set; }
        DateTime EditedDate { get; set; }
        string Tags { get; set; }
        string Lang { get; set;}


        ContentStatus Status { get; set;}
        long ClassID { get; set;}
        ICmsClass Class { get; set; }

        string Data { get; set;}
        byte[] BinaryData { get; set; }

        string[] VisibleRoles { get; set;}
        string[] EditableRoles { get; set;}


    }
    public interface ICmsObject : ICmsBaseObject
    {

        PropertyList ExtPropertyList { get;set;}
        IList<ICmsObject> SubObjectList { get; set;}
        IContentProperty GetExtProperty(string propertyName);
        object GetExtPropertyValue(string propertyName);
        void SetExtPropertyValue(string propertyName, object value);
        long ParentID { get; set;}
        short ClassTypeID { get;set;}
        bool FromCmsObject(ICmsObject obj);

    }

    public interface IPage : ICmsObject
    {
        int Order { get; set;}
        bool Inherit { get; set;}
        long TemplateID { get;set;}

        PageList SubPageList { get; set; }
        ContentCategoryList CategoryList { get; set;}
        ContentList ContentList { get; set;}
        AdContentList AdContentList { get; set;}

        bool IsActive { get; set; }
        bool IsCurrentPage { get; set;}
        bool Hidden { get; set; }
        short Type { get; set; }
        short PageType { get; set; }
        string KeyWords { get; set;}
        PageMenuDisplay Display { get; set; }
    }
    public interface IContentCategory : ICmsObject
    {
        int Order { get; set;}

        ContentCategoryList CategoryList { get; set;}
        ContentList ContentList { get; set;}
        AdContentList AdContentList { get; set;}

        CategoryMenuDisplay Display { get; set; }
    }

    public interface IContent : ICmsObject
    {
        ContentNoteList NoteList { get; set; }
        DateTime PublishedDate { get;set;}
        string Source { get; set;}
        bool IsHot { get;set;}
        string AuthorNews { get;set;}
        int NumberOfRead { get;set;}
        bool CommentEnabled { get; set;}
        string Title { get;set;}
        string Content { get;set;}
        string Summary { get;set;}
        long PageID { get; set;}
        long CategoryID { get;set;}
        string AuthorName { get;set;}
        string AuthorInfo { get;set;}
    }

    public interface IProduct : ICmsObject
    {
        string Code { get;set;}
        DateTime PublishedDate { get;set;}

        string Summary { get;set;}
        string Content { get;set;}
        long ImageTN { get;set;}
        long ImagePV { get;set;}

        double Price { get; set;}
        double PriceSale { get; set;}
        double Discount { get;set;}
        string Seller { get;set;}


        long PageID { get; set;}
        long CategoryID { get;set;}
    }

    public interface IContentNote : ICmsObject
    {
        ActionType ActionType { get;set;}
        NoteType Type { get;set;}
        string AuthorName { get;set;}

    }
    public interface IAdContent : ICmsObject
    {
        string Url { get; set; }
        string Name { get; set;}
        string Description { get; set; }
        string ToolTip { get; set; }
        string Extention { get; set; }
        //long PageID { get; set; }
        PageList PageList { get; set;}
        AdType Type { get; set; }


    }
    public interface ITemplate : ICmsObject
    {
        TemplateType Type { get; set;}
        string TemplateContent { get; set; }
    }
    public interface IContentProperty : IXml
    {
        string Name { get; set;}
        string DisplayName { get; set; }
        string Description { get; set; }
        object Value { get; set;}
        DataType Type { get; set; }
        InputType InputType { get; set; }
        PropertyType PropertyType { get; set;}
    }
    public interface IResource : ICmsObject
    {
        ResourceType Type { get; set;}
    }

    public interface IResourceFolder : IResource
    {
        ResourceFolderList SubFolderList { get;set;}
        ResourceFileList FileList { get;set;}
    }



    public interface IResourceFile : IResource
    {
        long Size { get;set;}
        long FolderID { get;set;}
        DateTime UploadDate { get;set;}
        string Extention { get;set;}

    }



    public interface IUser : ICmsObject
    {
        string[] Roles { get; set; }
        string Email { get; set;}
        string Password { get; set;}
        string UserName { get; set; }
        string Firstname { get;set;}
        string Lastname { get;set;}
        string Middle { get;set;}
        string Address { get;set;}
        string Phone { get;set;}
        string Zipcode { get;set;}
        string City { get;set;}
        string Country { get;set;}


        //UserType Type { get;set;}    

    }

    public interface IRole : ICmsObject
    {
        /*
        bool IsUserInRole(IUser user);
        bool IsUserInRole(string userName);        
        */
    }

    public interface IMedia : ICmsObject
    {

        MediaType MediaType { get;set;}

    }

    public interface IOrder : ICmsObject
    {
        long CustomerID { get;set;}
        string Code { get;set;}
        DateTime OrderCreated { get;set;}
        DateTime OrderLastUpdated { get;set;}
        string ShippingAddress1 { get;set;}
        string ShippingAddress2 { get;set;}
        string ShippingCountry { get;set;}
        string ShippingState { get;set;}
        string ShippingCity { get;set;}
        OrderStatus OrderStatus { get;set;}
        string OrderComments { get;set;}

        short Tax { get;set;}
        double Total { get;}

        OrderLineList OrderLineList { get;set;}
    }


    public interface IOrderLine : ICmsObject
    {
        long OrderID { get;set;}
        long ProductID { get;set;}
        int Quantity { get;set;}
        double Price { get;set;}
        double SalePrice { get;set;}
        double Total { get;}
    }

    public interface IVideo : ICmsObject
    {
        string FileName { get; set;}
        bool Sharing { get; set;}
        long Views { get; set;}
        long CategoryID { get; set;}
        string Thumbnail { get; set;}
        int Rates { get; set;}
    }

    public interface IFAQ : ICmsObject
    {
        string Question { get; set;}
        string Answer { get; set;}
        string Email { get; set;}
        string Address { get; set;}
        string UserName { get; set;}
        bool Show { get; set;}
    }

}
